Clean up settings#774
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the project’s settings initialization to take advantage of a newer attrs release, removing a previous workaround around Attribute.alias handling and simplifying the default-factory logic used for environment-driven settings.
Changes:
- Bump runtime dependency on
attrsto>=26.1.0(and update lockfile accordingly). - Refactor the per-field default factory builder into a module-level helper and remove the prior
aliasfallback workaround. - Align deprecation messaging / env-var translation to use
fld.aliasdirectly.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
uv.lock |
Locks attrs to 26.1.0 and updates the dev metadata constraint accordingly. |
pyproject.toml |
Raises the minimum supported attrs version to >=26.1.0. |
baybe/settings.py |
Moves the default-factory builder to global scope and relies on Attribute.alias directly for env var naming and deprecation guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
PR currently blocked by external issue |
7593f93 to
5f2b06c
Compare
|
@AdrianSosic what happened here? the external issue you said is connected has not changed? |
No, it has not changed, but it is very unclear when it will. So merging the PR now was still valuable, even though it only removed the first blocker for the workaround, since it brought other improvements and was completely functional. So there is simply a TODO note in the code (though now pointing to a different issue than the original one). |
Applies two minor changes:
attrsto latest release. Solves the original problem for thealiasworkaround, but upgrading surfaced another issue, hence keeping the workaround.